<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" placeholder="请输入1-100之间的整数">
<input type="text">
<input type="button" value="猜一猜" onclick="fn()">
<h1></h1>

<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script>
    let s = parseInt(Math.random()*100+1);
    $("input:eq(1)").val(s);
    function fn() {
        let x = $("input:eq(0)").val();
        if(x>s){
            $("h1").text("太大了!");
        }else if(x<s){
            $("h1").text("太小了!");
        }else{
            $("h1").text("猜对了!")
        }

    }
</script>
</body>
</html>